@layout("/common/_container.html"){
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal" id="teaInfoForm">

            <input type="hidden" id="id" value="${tea.id}">

            <div class="row">
                <div class="col-sm-12 b-r">
                    <div class="page-header">
                        <p class="text-center" style="font-size:32px;">基本信息</p>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6 b-r">
                    <#input id="name" name="茶叶名称" underline="true" value="${tea.name}"/>
                    <#selectOther id="type" name="茶叶种类"  underline="true" value="${tea.type}">
                        <option value="黑茶" class="type">黑茶</option>
                        <option value="白茶" class="type">白茶</option>
                        <option value="绿茶" class="type">绿茶</option>
                        <option value="乌龙茶" class="type">乌龙茶</option>
                        <option value="红茶" class="type">红茶</option>
                        <option value="黄茶" class="type">黄茶</option>
                        <option value="花茶" class="type">花茶</option>
                        <option value="再加工茶" class="type">再加工茶</option>
                        <option value="其它" class="type">其它</option>
                    </#selectOther>
                    <#selectOther id="packingType" name="包装种类"  underline="true" value="${tea.packingType}">
                        <option value="盒装" class="packingType">盒装</option>
                        <option value="罐装" class="packingType">罐装</option>
                        <option value="其它" class="packingType">其它</option>
                    </#selectOther>
                    <#input id="price" name="价格(元)" underline="true" value="${tea.price}"/>
                    <#select id="brewsId" name="冲泡方式"  underline="true">
                        @if(brewsList.~size>0){
                            @for(item in brewsList){
                                <option value="${item.id}"
                                @if(item.id == tea.brewsId){
                                        selected="selected"
                                @}
                                >${item.name}</option>
                            @}
                        @}
                    </#select>
                    <#input id="productionDate" name="生产日期" underline="true" type="date" value="${tea.productionDate}"
                            clickFun="laydate({istime: false, format: 'YYYY-MM-DD'})"/>
                    <!--保存天数-->
                    <div class="form-group has-feedback">
                        <label class="col-sm-3 control-label">保存天数(单位:天）</label>
                        <div class="col-sm-6">
                            <input class="form-control" id="expiryDay" name="expiryDay"  type="text" data-bv-field="expiryDay"
                            @if(tea.expiryDay != null){
                                @if(tea.expiryDay == -1){
                                    disabled = true;
                                    value="-1"
                                @}else{
                                    value="${tea.expiryDay}"
                                @}
                            @}
                            >
                            <i class="form-control-feedback" data-bv-icon-for="expiryDay" style="display: none;"></i>
                            <small class="help-block" data-bv-validator="regexp" data-bv-for="expiryDay" data-bv-result="NOT_VALIDATED" style="display: none;">只能是数字,例如 180</small>
                        </div>
                        <div class="col-sm-2">
                            <label class="control-label">长期保存：</label>
                        </div>
                        <div class="col-sm-1">
                            <input class="form-control" type="checkbox" id="expiryDayCheckbox" value="-1" onchange="TeaFileInfoDlg.changeCheckbox()"
                            @if(tea.expiryDay != null){
                                @if(tea.expiryDay == -1){
                                    checked = "true"
                                @}else{
                                    value="${tea.expiryDay}"
                                @}
                            @}
                            >
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <!--存储方法-->
                    <div class="form-group has-feedback">
                        <label class="col-sm-3 control-label">存储方法</label>
                        <div class="col-sm-5">
                            <select id="storageMethod" class="selectpicker control-label" value="${tea.storageMethod}" multiple>
                                <option>密封</option>
                                <option>遮光</option>
                                <option>干燥</option>
                                <option>无异味</option>
                                <option>冷藏</option>
                            </select>
                        </div>
                        <!--<div class="col-sm-4">-->
                            <!--<input class="form-control" type="text" id="" value="" placeholder="填写其它存储方式"/>-->
                        <!--</div>-->
                    </div>
                    <div class="hr-line-dashed"></div>
                    <!--功效介绍-->
                    <div class="b-r form-group">
                        <label class="col-sm-3 control-label">功效介绍</label>
                        <div class="col-sm-9">
                            <textarea id="effectIntroduce" name="effectIntroduce" class="form-control" rows="4" cols="30">${tea.effectIntroduce}</textarea>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="b-r">
                        <label class="col-sm-3 control-label">产地</label>
                        <div id="address" address="${tea.address}" class="form-group col-sm-5">
                            <select id="address_prov" class="prov form-control " name="address_prov"></select>
                            <select id="address_city" class="city form-control " name="address_city" disabled="disabled"></select>
                        </div>
                        <div  class="form-group col-sm-4">
                            <input id="addressOther" class="form-control" type="text" value="${tea.address}" placeholder="请输入自定义的产地" style="display: none">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6" >
                    <#input id="code" name="茶叶编码" underline="true" value="${tea.code}"/>
                    <#selectOther id="technology" name="工艺"  underline="true" value="${tea.technology}">
                        <option value="全发酵" class="technology">全发酵</option>
                        <option value="半发酵" class="technology">半发酵</option>
                        <option value="轻微发酵" class="technology">轻微发酵</option>
                        <option value="不发酵" class="technology">不发酵</option>
                        <option value="其它" class="technology">其它</option>
                    </#selectOther>
                    <#selectOther id="packingMethod" name="包装方式"  underline="true" value="${tea.packingMethod}">
                        <option value="压饼" class="packingMethod">压饼</option>
                        <option value="散茶" class="packingMethod">散茶</option>
                        <option value="其它" class="packingMethod">其它</option>
                    </#selectOther>
                    <#input id="processMethod" name="加工过程" underline="true" value="${tea.processMethod}"/>
                    <#input id="shopUrl" name="购买链接" underline="true" value="${tea.shopUrl}"/>
                    <#input id="packingDate" name="包装日期" underline="true" type="date" value="${tea.packingDate}"
                            clickFun="laydate({istime: false, format: 'YYYY-MM-DD'})"/>
                    <#input id="weight" name="净重量(单位:g）" underline="true" value="${tea.weight}"/>
                    <#input id="produceLicense" name="生产许可" underline="true" value="${tea.produceLicense}"/>
                    <!--品牌介绍-->
                    <div class="b-r form-group">
                        <label class="col-sm-3 control-label">品牌介绍</label>
                        <div class="col-sm-9">
                            <textarea id="brandIntroduce" name="brandIntroduce" class="form-control" rows="4" cols="30">${tea.brandIntroduce}</textarea>
                        </div>
                    </div>
                </div>
            </div>
            <div class="hr-line-dashed"></div>

            <div class="row">
                <div class="col-sm-12 b-r">
                    <div class="hr-line-dashed"></div>
                    <div class="page-header">
                        <p class="text-center" style="font-size:32px;">图文信息</p>
                    </div>
                </div>
            </div>
            <div class="row">
                <!--右侧-->
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-sm-1 control-label">茶叶特点图片：</label>
                        <div class="col-sm-1">
                            <#button name="关联图片" icon="fa-picture-o" clickFun="TeaFileInfoDlg.openPictureSelector('茶叶介绍')" space="true"/>
                        </div>
                        <!--图片显示区-->
                        <div class="col-sm-2">
                            @if(has(pictureMap1)){
                                <img id="img0" selId="${pictureMap1.id}" src="${pictureMap1.src}" height="100" width="100" >
                            @}else{
                                <img id="img0" selId="" src="" height="100" width="100" style="display:none;">
                            @}
                        </div>
                        <div class="col-sm-2">
                            @if(has(pictureMap2)){
                                <img id="img1" selId="${pictureMap2.id}" src="${pictureMap2.src}" height="100" width="100" >
                            @}else{
                                <img id="img1" selId="" src="" height="100" width="100" style="display:none;">
                            @}
                        </div>
                        <div class="col-sm-2">
                            @if(has(pictureMap3)){
                                <img id="img2" selId="${pictureMap3.id}" src="${pictureMap3.src}" height="100" width="100" >
                            @}else{
                                <img id="img2" selId="" src="" height="100" width="100" style="display:none;">
                            @}
                        </div>
                        <div class="col-sm-2">
                            @if(has(pictureMap4)){
                                <img id="img3" selId="${pictureMap4.id}" src="${pictureMap4.src}" height="100" width="100" >
                            @}else{
                                <img id="img3" selId="" src="" height="100" width="100" style="display:none;">
                            @}
                        </div>
                        <div class="col-sm-2">
                            @if(has(pictureMap5)){
                                <img id="img4" selId="${pictureMap5.id}" src="${pictureMap5.src}" height="100" width="100" >
                            @}else{
                                <img id="img4" selId="" src="" height="100" width="100" style="display:none;">
                            @}
                        </div>
                    </div>
                </div>
            </div>
            <div class="hr-line-dashed"></div>

            <div class="row">
                <!--右侧-->
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-sm-1 control-label">茶叶品牌图片：</label>
                        <div class="col-sm-1">
                            <#button name="关联图片" icon="fa-picture-o" clickFun="TeaFileInfoDlg.openPictureSelector('品牌介绍')" space="true"/>
                        </div>
                        <!--图片显示区-->
                        <div class="col-sm-2">
                            @if(has(pictureMap6)){
                                <img id="img5" selId="${pictureMap6.id}" src="${pictureMap6.src}" height="100" width="100" >
                            @}else{
                                <img id="img5" selId="" src="" height="100" width="100" style="display:none;">
                            @}
                        </div>
                        <div class="col-sm-2">
                            @if(has(pictureMap7)){
                                <img id="img6" selId="${pictureMap7.id}" src="${pictureMap7.src}" height="100" width="100" >
                            @}else{
                                <img id="img6" selId="" src="" height="100" width="100" style="display:none;">
                            @}
                        </div>
                        <div class="col-sm-2">
                            @if(has(pictureMap8)){
                                <img id="img7" selId="${pictureMap8.id}" src="${pictureMap8.src}" height="100" width="100" >
                            @}else{
                                <img id="img7" selId="" src="" height="100" width="100" style="display:none;">
                            @}
                        </div>
                        <div class="col-sm-2">
                            @if(has(pictureMap9)){
                                <img id="img8" selId="${pictureMap9.id}" src="${pictureMap9.src}" height="100" width="100" >
                            @}else{
                                <img id="img8" selId="" src="" height="100" width="100" style="display:none;">
                            @}
                        </div>
                        <div class="col-sm-2">
                            @if(has(pictureMap10)){
                                <img id="img9" selId="${pictureMap10.id}" src="${pictureMap10.src}" height="100" width="100" >
                            @}else{
                                <img id="img9" selId="" src="" height="100" width="100" style="display:none;">
                            @}
                        </div>
                    </div>
                </div>
            </div>
            <div class="hr-line-dashed"></div>

            <div class="row">
                <!--右侧-->
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-sm-1 control-label">产品包装图片：</label>
                        <div class="col-sm-1">
                            <#button name="关联图片" icon="fa-picture-o" clickFun="TeaFileInfoDlg.openPictureSelector('产品包装')" space="true"/>
                        </div>
                        <!--图片显示区-->
                        <div class="col-sm-2">
                            @if(has(pictureMap11)){
                                <img id="img10" selId="${pictureMap11.id}" src="${pictureMap11.src}" height="100" width="100" >
                            @}else{
                                <img id="img10" selId="" src="" height="100" width="100" style="display:none;">
                            @}
                        </div>
                        <div class="col-sm-2">
                            @if(has(pictureMap12)){
                                <img id="img11" selId="${pictureMap12.id}" src="${pictureMap12.src}" height="100" width="100" >
                            @}else{
                                <img id="img11" selId="" src="" height="100" width="100" style="display:none;">
                            @}
                        </div>
                        <div class="col-sm-2">
                            @if(has(pictureMap13)){
                                <img id="img12" selId="${pictureMap13.id}" src="${pictureMap13.src}" height="100" width="100" >
                            @}else{
                                <img id="img12" selId="" src="" height="100" width="100" style="display:none;">
                            @}
                        </div>
                        <div class="col-sm-2">
                            @if(has(pictureMap14)){
                                <img id="img13" selId="${pictureMap14.id}" src="${pictureMap14.src}" height="100" width="100" >
                            @}else{
                                <img id="img13" selId="" src="" height="100" width="100" style="display:none;">
                            @}
                        </div>
                        <div class="col-sm-2">
                            @if(has(pictureMap15)){
                                <img id="img14" selId="${pictureMap15.id}" src="${pictureMap15.src}" height="100" width="100" >
                            @}else{
                                <img id="img14" selId="" src="" height="100" width="100" style="display:none;">
                            @}
                        </div>
                    </div>
                </div>
            </div>
            <div class="row btn-group-m-t">
                <div class="col-sm-10">
                    <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TeaFileInfoDlg.editSubmit()"/>
                    <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TeaFileInfoDlg.close()"/>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 省市互联插件 -->
<link href="${ctxPath}\static\js\plugins\cityselect\css\main.css" rel="stylesheet" type="text/css"  />
<script src="${ctxPath}\static\js\plugins\cityselect\js\jquery.cityselect.js"></script>
<!--bootstrap-select-->
<link rel="stylesheet" href="${ctxPath}\static\css\plugins\bootstrap-select\bootstrap-select.css">
<script type="text/javascript" src="${ctxPath}\static\js\plugins\bootstrap-select\bootstrap-select.js"></script>

<script src="${ctxPath}/static/modular/fileManage/teaFile/teaFile_info.js"></script>
@}
